import 'dart:ui';

import 'package:fish_redux/fish_redux.dart';
import 'package:flutter/cupertino.dart';
import 'package:www.znpigai.teacher/home_page/subject_tab_component/item/state.dart';

import '../global_store/state.dart';

class SubjectEditState implements GlobalBaseState, Cloneable<SubjectEditState> {
  SubjectState subject;

  @override
  SubjectEditState clone() {
    return SubjectEditState()
      ..themeColor = themeColor
      ..userInfo = userInfo
      ..subject = subject;
  }

  @override
  Color themeColor;

  @override
  Map<String, dynamic> userInfo;
}

SubjectEditState initEditState(SubjectState args) {
  if (args == null) {
    args = SubjectState()
      ..title = ''
      ..demand = ''
      ..ideation = ''
      ..gradeList = []
      ..themeList = []
      ..typeList = []
      ..articleTypeList = []
      ..editionList = []
      ..tagList = []
      ..keywordList = [];
  }
  args.keywordList?.remove('');

  return SubjectEditState()..subject = args;
}
